import { readFileSync, createReadStream, readdirSync } from 'fs';
import { join } from 'path';
import { request, getOptions, postOptions, getSignature, getHeaders } from './utils/request';
import multiparty from 'multiparty';
import { apiServer } from './utils/config';
import { excelToObject } from './utils/common';
import http from 'http';
import util from 'util';
import querystring from 'querystring';
import { post } from 'request';
import Mock from './mock';

export default function (req, res, next) {
    var mock = Mock.filter(function (item) {
        return item.url == req.url;
    })
    if (mock.length > 0) {
        res.send(mock[0].getResponse());
    }
    else {
        next();
    }
}

